package com.job.didi;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author angzhijin
 * @Description
 * @create 2022-09-04 7:52 PM
 */
public class Didi0904 {
    public static void main(String[] args) {
        a(args);
    }


    public static void a(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] peach = new int[n+1];
        for (int i = 1; i <= n; i++) {
            peach[i] = sc.nextInt();
        }
        Arrays.sort(peach);
        int sum =0;
        for (int i = 1; i <= n; i++) {
            sum += peach[i];
            if (sum < (i * (double)peach[i])/k){
                System.out.println(i-1);
                return;
            }
        }
        System.out.println(n);
    }
}
